<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include :: appHeader"></head>
<style>
    .list-left {
        flex: 1;
        height: 66px;
        width: 66px;
        display: inline-block;
        float: left;
        padding: 2px;
    }
    .list-left-bg-yuanliao{
        background:url('/img/list/yuanliaoxialiao.png') no-repeat;
        background-size:cover;overflow: hidden;
    }
    .list-left-bg-xialiao{
        background:url('/img/list/yuanliaoxialiao.png') no-repeat;
        background-size:cover;overflow: hidden;
    }
    .list-left-bg-waixie{
        background:url('/img/list/waixie.png') no-repeat;
        background-size:cover;overflow: hidden;
    }
    .list-left-bg-maohan{
        background:url('/img/list/maohancanhan.png') no-repeat;
        background-size:cover;overflow: hidden;
    }
    .list-left-bg-canhan{
        background:url('/img/list/maohancanhan.png') no-repeat;
        background-size:cover;overflow: hidden;
    }
    .list-left-bg-pentu{
        background:url('/img/list/pentujijia.png') no-repeat;
        background-size:cover;overflow: hidden;
    }
    .list-left-bg-jijia{
        background:url('/img/list/pentujijia.png') no-repeat;
        background-size:cover;overflow: hidden;
    }
    .list-left-bg-zhuangpei{
        background:url('/img/list/zhuangpei.png') no-repeat;
        background-size:cover;overflow: hidden;
    }
    .list-left-bg-zhuanchu{
        background:url('/img/list/zhuancu.png') no-repeat;
        background-size:cover;overflow: hidden;
    }
    .list-left-bg-dianqichejian{
        background:url('/img/list/zhuancu.png') no-repeat;
        background-size:cover;overflow: hidden;
    }
</style>
<body ontouchstart>
<!--首页 tabbar -->
<div class="weui-tab">
    <div class="weui-tab__bd">
        <div id="tab2" class="weui-tab__bd-item weui-tab__bd-item--active">
            <div class="weui-btn-area"
                 onclick="popApplySearchPanel()"
                 style="border: #6d6d72 1px solid;
                        margin-left: 2px;
                        margin-right: 2px;
                        padding-left: 4px;
                        padding-right: 4px;">
                <input readonly="readonly"
                       type="search"
                       placeholder="搜索"
                       style="height: 35px;
                              font-size: 23px;
                              border: 0;
                              outline: none;
                              background-color: rgba(0, 0, 0, 0);"/>
                <img width="20px"
                     th:src="@{/img/magnifier.png}"/>
            </div>
            <h1 th:if="${#lists.isEmpty(hisApply)} and ${oldDataTrip == null}" style="margin-top: 64px;text-align: center">查无记录</h1>
            <h1 th:if="${#lists.isEmpty(hisApply)} and ${oldDataTrip != null}" th:text="${oldDataTrip}" style="margin-top: 64px;text-align: center"></h1>
            <div class="his-apply" th:each="ha : ${hisApply}">
                <div class="weui-form-preview__hd">
                    <div class="weui-form-preview__item" onclick="gotoHisApplyOper(this)" th:data-id="${ha.id}">
                        <div th:if="${ha.transMode == 1}"
                             th:class="${ha.route} eq '原料'?'list-left list-left-bg-yuanliao':(${ha.route} eq '下料'?'list-left list-left-bg-yuanliao':(${ha.route} eq '外协'?'list-left list-left-bg-waixie':(${ha.route} eq '铆焊'?'list-left list-left-bg-maohan':(${ha.route} eq '参焊'?'list-left list-left-bg-canhan':(${ha.route} eq '喷涂'?'list-left list-left-bg-pentu':(${ha.route} eq '机加'?'list-left list-left-bg-jijia':(${ha.route} eq '装配'?'list-left list-left-bg-zhuangpei':(${ha.route} eq '转储'?'list-left list-left-bg-zhuanchu':(${ha.route} eq '电气车间'?'list-left list-left-bg-dianqichejian':'list-left list-left-bg-dianqichejian')))))))))">
                            <span class="weui-form-preview__label"
                                  style="line-height:62px;
                                      color:white;
                                      font-size:18px;
                                      text-align: center;
                                      text-align-last:center;
                                      text-shadow: 1px 1px 1px #000, -1px -1px 1px #fff;"
                                  th:text="${ha.route}">
                            </span>
                        </div>
                        <div th:if="${ha.transMode == 2}"
                             th:class="${ha.route} eq '原料'?'list-left list-left-bg-yuanliao':(${ha.route} eq '下料'?'list-left list-left-bg-yuanliao':(${ha.route} eq '外协'?'list-left list-left-bg-waixie':(${ha.route} eq '铆焊'?'list-left list-left-bg-maohan':(${ha.route} eq '参焊'?'list-left list-left-bg-canhan':(${ha.route} eq '喷涂'?'list-left list-left-bg-pentu':(${ha.route} eq '机加'?'list-left list-left-bg-jijia':(${ha.route} eq '装配'?'list-left list-left-bg-zhuangpei':(${ha.route} eq '转储'?'list-left list-left-bg-zhuanchu':(${ha.route} eq '电气车间'?'list-left list-left-bg-dianqichejian':'list-left list-left-bg-dianqichejian')))))))))">
                            <span class="weui-form-preview__label"
                                  style="clear: both;
                                      line-height:31px;
                                      color:white;
                                      font-size:18px;
                                      text-align: center;
                                      text-align-last:center;
                                      text-shadow: 1px 1px 1px #000, -1px -1px 1px #fff;"
                                  th:text="${ha.route}">
                            </span>
                            <span class="weui-form-preview__label"
                                  style="clear: both;
                                      line-height:31px;
                                      color:white;
                                      font-size:18px;
                                      text-align: center;
                                      text-align-last:center;
                                      text-shadow: 1px 1px 1px #000, -1px -1px 1px #fff;"
                                  th:text="${ha.process}">
                            </span>
                        </div>
                        <div  th:if="${ha.result != null and ha.result eq '质检不合格'}"
                                style="flex:3;
                                    display: inline-block;
                                    float:left;
                                    height: 70px;
                                    margin-left: 7px;

                                    ">
                            <div class="weui-form-preview__label"
                                 style="clear: both;
                                      height:20px;
                                      font-size: 18px;
                                      color: black;
                                      vertical-align: top;">
                                <span style="float: left;color: #ff3b30;"
                                      th:text="${ha.prodNo}">
                                </span>
                                <span style="position: absolute;
                                             right: 5%;
                                             font-size: 14px;
                                             color: #9999aa"
                                      th:if="${ha.type == 1}">
                                    制作件
                                </span>
                                <span style="position: absolute;
                                             right: 5%;
                                             font-size: 14px;
                                             color: #9999aa"
                                      th:if="${ha.type == 2}">
                                    装配件
                                </span>
                                <span style="position: absolute;
                                             right: 5%;
                                             font-size: 14px;
                                             color: #9999aa"
                                      th:if="${ha.type == 3}">
                                    返修票
                                </span>
                            </div>
                            <div class="weui-form-preview__label"
                                 style="clear: both;
                                      height:20px;
                                      font-size: 14px;">
                                <span style="float: left;color: #ff3b30;"
                                      th:text="${ha.drawName}">
                                </span>
                                <span style="position: absolute;
                                             right: 5%;
                                             font-size: 14px;
                                             color: #9999aa"
                                      th:text="${#dates.format(ha.applyTime, 'yyyy-MM-dd')}">
                                </span>
                            </div>
                            <b class="weui-form-preview__label"
                               style="clear: both;
                                      height:30px;
                                      font-size: 14px;
                                      color: #ff3b30;"
                               th:text="${ha.drawNo}">
                            </b>
                        </div>
                        <div  th:if="${ha.result == null or ha.result eq '质检合格'}"
                              style="flex:3;
                                    display: inline-block;
                                    float:left;
                                    height: 70px;
                                    margin-left: 7px;
                                    ">
                            <div class="weui-form-preview__label"
                                 style="clear: both;
                                      height:20px;
                                      font-size: 18px;
                                      color: black;
                                      vertical-align: top;">
                                <span style="float: left;"
                                      th:text="${ha.prodNo}">
                                </span>
                                <span style="position: absolute;
                                             right: 5%;
                                             font-size: 14px;
                                             color: #9999aa"
                                      th:if="${ha.type == 1}">
                                    制作件
                                </span>
                                <span style="position: absolute;
                                             right: 5%;
                                             font-size: 14px;
                                             color: #9999aa"
                                      th:if="${ha.type == 2}">
                                    装配件
                                </span>
                                <span style="position: absolute;
                                             right: 5%;
                                             font-size: 14px;
                                             color: #9999aa"
                                      th:if="${ha.type == 3}">
                                    返修票
                                </span>
                            </div>
                            <div class="weui-form-preview__label"
                                 style="clear: both;
                                      height:20px;
                                      font-size: 14px;">
                                <span style="float: left;"
                                      th:text="${ha.drawName}">
                                </span>
                                <span style="position: absolute;
                                             right: 5%;
                                             font-size: 14px;
                                             color: #9999aa"
                                      th:text="${#dates.format(ha.applyTime, 'yyyy-MM-dd')}">
                                </span>
                            </div>
                            <b class="weui-form-preview__label"
                               style="clear: both;
                                      height:30px;
                                      font-size: 14px;"
                               th:text="${ha.drawNo}">
                            </b>
                        </div>
                        <!--                        <div style="flex:1;-->
                        <!--                                    display: inline-block;-->
                        <!--                                    font-size: 14px;-->
                        <!--                                    color: #9999aa;-->
                        <!--                                    float:right"-->
                        <!--                             th:if="${ha.type == 1}">制作件-->
                        <!--                        </div>-->
                        <!--                        <div style="flex:1;-->
                        <!--                                    display: inline-block;-->
                        <!--                                    font-size: 14px;-->
                        <!--                                    color: #9999aa;-->
                        <!--                                    float:right"-->
                        <!--                             th:if="${ha.type == 2}">装配件-->
                        <!--                        </div>-->
                        <!--                        <div style="flex:1;-->
                        <!--                                    display: inline-block;-->
                        <!--                                    font-size: 14px;-->
                        <!--                                    color: #9999aa;-->
                        <!--                                    float:right"-->
                        <!--                             th:if="${ha.type == 3}">返修票-->
                        <!--                        </div>-->
                        <!--                        <b class="weui-form-preview__label"-->
                        <!--                           th:if="${ha.type == 1}"></b>-->
                        <!--                        <b class="weui-form-preview__label"-->
                        <!--                           th:if="${ha.type == 2}">装配件</b>-->
                        <!--                        <b class="weui-form-preview__label"-->
                        <!--                           th:if="${ha.type == 3}">返修票</b>-->
                        <!--                        <b class="weui-form-preview__item"-->
                        <!--                           th:if="${ha.transMode == 1}"-->
                        <!--                           style="word-wrap: break-word;-->
                        <!--                                  word-break: break-all;-->
                        <!--                                  overflow: hidden;-->
                        <!--                                  width: 250px;-->
                        <!--                                  float: left!important;-->
                        <!--                                  font-weight:bold;-->
                        <!--                                  text-align:left;"-->
                        <!--                           th:text="${ha.prodNo}+'-'+${ha.drawName}+'-'+${ha.drawNo}+'-'+${ha.route}+'-'+${T(com.zw.transition.util.ServiceUtil).trans(ha.status)}">-->
                        <!--                        </b>-->
                        <!--                        <b class="weui-form-preview__item"-->
                        <!--                           th:if="${ha.transMode == 2}"-->
                        <!--                           style="word-wrap: break-word;-->
                        <!--                                  word-break: break-all;-->
                        <!--                                  overflow: hidden;-->
                        <!--                                  width: 250px;-->
                        <!--                                  float: left!important;-->
                        <!--                                  font-weight:bold;-->
                        <!--                                  text-align:left;"-->
                        <!--                           th:text="${ha.prodNo}+'-'+${ha.drawName}+'-'+${ha.drawNo}+'-'+${ha.route}+'-'+${ha.process}+'-'+${T(com.zw.transition.util.ServiceUtil).trans(ha.status)}"></b>-->
                    </div>
                </div>
            </div>
            <div style="height: 70px"></div>
        </div>
    </div>

    <div class="weui-tabbar">
        <a th:href="@{/index}" class="weui-tabbar__item weui-bar__item--on">
            <div class="weui-tabbar__icon">
                <img th:src="@{/img/me.png}" alt="">
            </div>
            <p class="weui-tabbar__label">我的信息</p>
        </a>

<!--        &lt;!&ndash;生产历史&ndash;&gt;-->
<!--        <a th:if="${#strings.contains(session.user.roles,'【申请质检】')}" th:href="@{/hisApply/null/null}" class="weui-tabbar__item">-->
<!--            <div class="weui-tabbar__icon">-->
<!--                <img th:src="@{/img/his_apply.png}" alt="">-->
<!--            </div>-->
<!--            <p class="weui-tabbar__label">历史申请</p>-->
<!--        </a>-->
        <a th:if="${#strings.contains(session.user.roles,'【转序接收】')}" th:href="@{/hisRec/null/null}" class="weui-tabbar__item">
            <div class="weui-tabbar__icon">
                <img th:src="@{/img/his_rec.png}" alt="">
            </div>
            <p class="weui-tabbar__label">历史接收</p>
        </a>
        <a th:if="${#strings.contains(session.user.roles,'【转序质检】')}" th:href="@{/hisCheck/null/null}" class="weui-tabbar__item">
            <div class="weui-tabbar__icon">
                <img th:src="@{/img/his_check.png}" alt="">
            </div>
            <p class="weui-tabbar__label">历史质检</p>
        </a>
        <a th:if="${#strings.contains(session.user.roles,'【入库质检】')}" onclick="tips()" href="javascript:void(0)" class="weui-tabbar__item">
            <div class="weui-tabbar__icon">
                <img th:src="@{/img/his_check.png}" alt="">
            </div>
            <p class="weui-tabbar__label">入库历史质检</p>
        </a>
    </div>
</div>
<div id="pop-query" class="weui-popup__container popup-bottom">
    <div class="weui-popup__overlay"></div>
    <div class="weui-popup__modal">
        <div class="toolbar">
            <div class="toolbar-inner">
                <a href="javascript:void(0);" class="picker-button close-popup">关闭</a>
                <h1 class="title">搜索</h1>
            </div>
        </div>
        <div class="modal-content">
            <form id="success-form">
                <input id="success-id" type="hidden" name="transId">
                <div class="weui-cells weui-cells_form">
                    <div class="weui-cell weui-cell_switch">
                        <div class="weui-cell__bd">生产令号</div>
                        <div class="weui-cell__bd" style="-webkit-box-flex: 2;-webkit-flex: 2;flex: 2;">
                            <input class="weui-footer__text" style="height: 30px;font-size: 18px;" type="text" id="queryProdNo" value=""
                                   placeholder="请输入生产令编号"/>
                        </div>
                    </div>
                    <div class="weui-cell weui-cell_switch">
                        <div class="weui-cell__bd">图号</div>
                        <div class="weui-cell__bd" style="-webkit-box-flex: 2;-webkit-flex: 2;flex: 2;">
                            <input class="weui-footer__text" style="height: 30px;font-size: 18px;" type="text" id="queryDrawNo" value=""
                                   placeholder="请输入图号"/>
                        </div>
                    </div>
                </div>
            </form>
            <div class="weui-btn-area">
                <a class="weui-btn weui-btn_primary" href="javascript:void(0);" onclick="gotoHisApply()" id="btn-query-apply">查询</a>
            </div>
        </div>
    </div>
</div>
<a id="jumpPage" style="display: none" />
<div th:include="include :: appFooter"></div>
<script th:src="@{/js/app-index.js}"></script>
<script>
    function gotoHisApply(){
        let queryProdNo = document.getElementById("queryProdNo").value;
        let queryDrawNo = document.getElementById("queryDrawNo").value;
        if(queryProdNo == ''){
            queryProdNo = 'null';
        }
        if(queryDrawNo == ''){
            queryDrawNo = 'null';
        }
        // alert(queryDrawNo);
        $("#jumpPage").attr("href",ctx+'hisApply/'+queryProdNo+"/"+queryDrawNo);
        document.getElementById("jumpPage").click();//模拟点击
    }
    function gotoHisApplyOper(obj){
        $("#jumpPage").attr("href", ctx + 'gotoHisApplyOper/' + $(obj).attr("data-id"));
        document.getElementById("jumpPage").click();//模拟点击
    }
</script>
</body>
</html>